package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ChemicalsSowing generated by hbm2java
 */
@Entity
@Table(name="chemicals_sowing"
    ,catalog="madr_bd10"
)
public class ChemicalsSowing  implements java.io.Serializable {


     private Integer idCheSow;
     private String nameCheSow;
     private Boolean statusCheSow;
     private Set cropsTypeses = new HashSet(0);
     private Set sowings = new HashSet(0);

    public ChemicalsSowing() {
    }

    public ChemicalsSowing(String nameCheSow, Boolean statusCheSow, Set cropsTypeses, Set sowings) {
       this.nameCheSow = nameCheSow;
       this.statusCheSow = statusCheSow;
       this.cropsTypeses = cropsTypeses;
       this.sowings = sowings;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_che_sow", unique=true, nullable=false)
    public Integer getIdCheSow() {
        return this.idCheSow;
    }
    
    public void setIdCheSow(Integer idCheSow) {
        this.idCheSow = idCheSow;
    }
    
    @Column(name="name_che_sow", length=45)
    public String getNameCheSow() {
        return this.nameCheSow;
    }
    
    public void setNameCheSow(String nameCheSow) {
        this.nameCheSow = nameCheSow;
    }
    
    @Column(name="status_che_sow")
    public Boolean getStatusCheSow() {
        return this.statusCheSow;
    }
    
    public void setStatusCheSow(Boolean statusCheSow) {
        this.statusCheSow = statusCheSow;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="chemicals_sowing_crops_types", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_chemical_sowing_che_sow_cro_typ", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_crop_type_che_sow_cro_typ", nullable=false, updatable=false) })
    public Set getCropsTypeses() {
        return this.cropsTypeses;
    }
    
    public void setCropsTypeses(Set cropsTypeses) {
        this.cropsTypeses = cropsTypeses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="chemicalsSowing")
    public Set getSowings() {
        return this.sowings;
    }
    
    public void setSowings(Set sowings) {
        this.sowings = sowings;
    }




}


